<%@ page import="com.Web.Person.Student" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>

<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2024/8/12
  Time: 17:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        //JSP页面内置对象
        //pageContext、request、session、application(ServletContext)域对象，也是内置对象
        //document 内置对象：已经创建好的对象，而且名字也起好了
        //1.普通字符串
        pageContext.setAttribute("name", "zhangsan");
        request.setAttribute("name", "lisi");
        //2.Student对象
        Student student = new Student(1, "zhangsan", 23, "男");
        session.setAttribute("student", student);
        //3.List<Student>
        List<Student> list = new ArrayList<>();
        Student student1 = new Student(1, "zhangsan1", 23, "男");
        Student student2 = new Student(2, "zhangsan2", 23, "男");
        Student student3 = new Student(3, "zhangsan3", 23, "男");
        list.add(student1);
        list.add(student2);
        list.add(student3);
        application.setAttribute("list", list);
    %>
    ${pageScope.name}<br>
    ${requestScope.name}<br>
    ${name}<br>
    ${sessionScope.student.name}<br>
    ${student.age}<br>
    ${list}<br>
    ${list[0].name}<br>
</body>
</html>
